
export const getOptions = (xData: string[], yData: number[]) => {
  const option = {
    color: [
      '#29F1FA',
      '#5470c6',
      '#91cc75',
      '#fac858',
      '#ee6666',
      '#73c0de',
      '#3ba272',
      '#fc8452',
      '#9a60b4',
      '#ea7ccc'
    ],
    grid: {
      top: '40px',
      left: '40rem',
      bottom: '20px',
      right: '40rem'
    },
    tooltip: {
      trigger: 'axis'
    },
    xAxis: {
      type: 'category',
      boundaryGap: false,
      axisLabel: {
        color: '#777'
      },
      splitLine: {
        lineStyle: {
          color: ['#777']
        }
      },
      data: xData //['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
    },
    yAxis: {
      type: 'value',
      axisLabel: {
        color: '#777'
      },
      splitLine: {
        lineStyle: {
          color: ['#777']
        }
      },
      name: '单位：MW'
    },
    series: [
      {
        data: yData, //[820, 932, 901, 934, 1290, 1330, 1320],
        type: 'line',
        smooth: true,
        markPoint: {
          data: [
            { 
              type: 'max', 
              name: 'Max',
              label: {
                color: '#fff'
              }
            },
            {
              type: 'min',
              name: 'Min',
              label: {
                color: '#fff'
              }
            }
          ]
        }
        // areaStyle: {
        //   opacity: 0.1
        // }
      }
    ]
  }
  return option
}